import { ref } from 'vue'
import { defineStore } from 'pinia'
import type { userLoginData } from '@/types/user'

export const useUserStore = defineStore(
  'user',
  () => {
    const userinfo = ref<userLoginData>({
      refreshToken: '',
      token: ''
    })
    const token = ref('')

    return { token, userinfo }
  },
  {
    persist: {
      paths: ['token']
    }
  }
)
